package Vista;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.Font;
import java.awt.Dimension;
import net.miginfocom.swing.MigLayout;
import javax.swing.SwingConstants;
import java.awt.Color;
import javax.swing.border.LineBorder;
import javax.swing.JTable;

public class Panel_MCliente_Conce extends JPanel {

	// ATRIBUTOS
	// Paneles
	private JPanel panelPrin;
	private JPanel panelSup;
	private JPanel panelCentral;
	private JPanel panelInf;
	private JPanel panelSupMarca;
	private JPanel panelSupModelo;
	private JPanel panelSupCombus;
	private JPanel panelSupCV;
	private JPanel panelInfBotones;
	
	// Botones
	private JButton botonVPrevia;
	private JButton botonRestab;
	private JButton botonComprar;
	
	// Etiquetas
	private JLabel labelMarca;
	private JLabel labelModelo;
	private JLabel labelCombus;
	private JLabel labelCV;
	
	// ComboBox
	private JComboBox comboMarca;
	private JComboBox comboModelo;
	private JComboBox comboCombus;
	private JComboBox comboCV;
	private JTable table;
	
	
	public Panel_MCliente_Conce() {
		
		// Instanciar paneles
		panelPrin = new JPanel();
		panelSup = new JPanel();
		panelCentral = new JPanel();
		panelInf = new JPanel();
		panelSupMarca = new JPanel();
		panelSupModelo = new JPanel();
		panelSupModelo.setForeground(new Color(178, 34, 34));
		panelSupCombus = new JPanel();
		panelSupCV = new JPanel();
		panelInfBotones = new JPanel();
		
		
		// Instanciar botones
		botonVPrevia = new JButton("Vista previa");
		botonVPrevia.setFont(new Font("Dialog", Font.PLAIN, 20));
		botonRestab = new JButton("Restablecer");
		botonRestab.setFont(new Font("Dialog", Font.PLAIN, 20));
		botonComprar = new JButton("Comprar");
		botonComprar.setFont(new Font("Dialog", Font.BOLD, 20));
		
		// Instanciar etiquetas
		labelMarca = new JLabel("Marca");
		labelMarca.setFont(new Font("Dialog", Font.BOLD, 28));
		labelMarca.setPreferredSize(new Dimension(300, 15));
		labelMarca.setBackground(new Color(178, 34, 34));
		labelMarca.setForeground(Color.WHITE);
		labelMarca.setHorizontalAlignment(SwingConstants.CENTER);
		
		labelModelo = new JLabel("Modelo");
		labelModelo.setFont(new Font("Dialog", Font.BOLD, 28));
		labelModelo.setHorizontalAlignment(SwingConstants.CENTER);
		labelModelo.setForeground(Color.WHITE);
		labelModelo.setPreferredSize(new Dimension(300, 15));
		
		labelCombus = new JLabel("Combustible");
		labelCombus.setPreferredSize(new Dimension(300, 15));
		labelCombus.setHorizontalAlignment(SwingConstants.CENTER);
		labelCombus.setForeground(Color.WHITE);
		labelCombus.setFont(new Font("Dialog", Font.BOLD, 28));
		labelCombus.setBackground(new Color(178, 34, 34));
		
		labelCV = new JLabel("CV");
		labelCV.setPreferredSize(new Dimension(300, 15));
		labelCV.setHorizontalAlignment(SwingConstants.CENTER);
		labelCV.setForeground(Color.WHITE);
		labelCV.setFont(new Font("Dialog", Font.BOLD, 28));
		
		// Instanciar combobox
		comboMarca = new JComboBox();
		comboModelo = new JComboBox();
		comboCombus = new JComboBox();
		comboCV = new JComboBox();
		
		// Colocar paneles
		panelPrin.setLayout(new BorderLayout(2,2));
		panelPrin.add(panelSup, BorderLayout.NORTH);
		panelSup.setLayout(new MigLayout("", "[200.00,grow][68.00][200.00,grow]", "[grow][20.00][grow]"));
		
		panelSupMarca.setBorder(new LineBorder(new Color(178, 34, 34), 3, true));
		panelSupMarca.setBackground(new Color(178, 34, 34));
		panelSup.add(panelSupMarca, "cell 0 0,alignx right,aligny center");
		panelSupMarca.setLayout(new GridLayout(2, 0, 0, 0));
		
		panelSupMarca.add(labelMarca);
		panelSupMarca.add(comboMarca);

		panelSupModelo.setBorder(new LineBorder(new Color(178, 34, 34), 3));
		panelSupModelo.setBackground(new Color(178, 34, 34));
		panelSup.add(panelSupModelo, "cell 2 0,alignx left,aligny center");
		panelSupModelo.setLayout(new GridLayout(2, 0, 0, 0));
		
		panelSupModelo.add(labelModelo);
		panelSupModelo.add(comboModelo);
		
		panelSupCombus.setBorder(new LineBorder(new Color(178, 34, 34), 3));
		panelSupCombus.setBackground(new Color(178, 34, 34));
		panelSup.add(panelSupCombus, "cell 0 2,alignx right,growy");
		panelSupCombus.setLayout(new GridLayout(2, 0, 0, 0));
				
		panelSupCombus.add(labelCombus);
		panelSupCombus.add(comboCombus);

		panelSupCV.setBorder(new LineBorder(new Color(178, 34, 34), 3));
		panelSupCV.setBackground(new Color(178, 34, 34));
		panelSup.add(panelSupCV, "cell 2 2,alignx left,growy");
		panelSupCV.setLayout(new GridLayout(2, 0, 0, 0));
		
		
		panelSupCV.add(labelCV);
		panelSupCV.add(comboCV);
		
		panelPrin.add(panelCentral, BorderLayout.CENTER);
		
		table = new JTable();
		panelCentral.add(table);
		
		panelPrin.add(panelInf, BorderLayout.SOUTH);
		panelInf.setLayout(new BorderLayout(0,0));
		
		panelInf.add(botonVPrevia, BorderLayout.WEST);
		panelInf.add(panelInfBotones, BorderLayout.EAST);
		panelInfBotones.setLayout(new BorderLayout(10,0));
		panelInfBotones.add(botonComprar, BorderLayout.EAST);
		panelInfBotones.add(botonRestab, BorderLayout.WEST);
		
	}

}
